﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;

namespace IronBefunge.Core.Tests
{
	[TestClass]
	public sealed class ExecutorTests
	{
		[TestMethod, ExpectedException(typeof(ArgumentNullException))]
		public void CreateWithNullCellList()
		{
			using(var reader = new StringReader(string.Empty))
			{
				using(var writer = new StringWriter(CultureInfo.CurrentCulture))
				{
					new Executor(null, reader, writer);
				}
			}
		}

		[TestMethod, ExpectedException(typeof(ArgumentNullException))]
		public void CreateWithNullRandomizer()
		{
			using(var reader = new StringReader(string.Empty))
			{
				using(var writer = new StringWriter(CultureInfo.CurrentCulture))
				{
					new Executor(new ReadOnlyCollection<Cell>(new List<Cell>()), reader, writer, null);
				}
			}
		}

		[TestMethod, ExpectedException(typeof(ArgumentNullException))]
		public void CreateWithNullReader()
		{
			using(var writer = new StringWriter(CultureInfo.CurrentCulture))
			{
				new Executor(new ReadOnlyCollection<Cell>(new List<Cell>()), null, writer);
			}
		}

		[TestMethod, ExpectedException(typeof(ArgumentNullException))]
		public void CreateWithNullWriter()
		{
			using(var reader = new StringReader(string.Empty))
			{
				new Executor(new ReadOnlyCollection<Cell>(new List<Cell>()), reader, null);
			}
		}
	}
}
